<?php
//echo'<pre>';
//print_r($images);
//echo '<pre>';
//var_dump($listcategory);
//echo '<pre>';
//print_r($itemproduct);
//die;
?>
<form action="index.php?r=admin/product/editproduct" method="post" enctype="multipart/form-data" >
    <div class="form-group">
        <label>Name</label>
        <input class="form-control" style="width: 300px" name="name" value="<?php echo $itemproduct->name;?>">
        <p class="help-block">tên danh mục</p>
    </div>
    <div class="form-group">
        <label>Info</label>
        <?php $this->widget('application.extensions.eckeditor.ECKEditor', array(
            'model'=>$model,
            'attribute'=>'info',
        )); ?>
        <p class="help-block">Thông tin sản phẩm</p>

    </div>
    <div class="form-group">
        <label>cost</label>
        <input class="form-control" style="width: 300px" name="cost" value="<?php echo $itemproduct->cost?>">
        <p class="help-block">Giá sản phẩm</p>
    </div>
    <div class="form-group">
        <label>image đại diện sản phẩm</label>
        <img style="width: 300px;height:200px; border: 1px solid #cccccc;" src="<?php echo $itemproduct->images?>"/>
        <input type="file" name="file_upload">
    </div>

    <div class="bs-example">
        <div class="row">
            <?php foreach($images as $key => $value){?>
            <div class="col-xs-2">
                <img  style="height: 250px; width: 200px; border: 1px solid #cccccc" src="<?php echo $value->destination;?>"/>
                <a href="<?php echo Yii::app()->createUrl('admin/product/DeleteImageSlide',array('id'=>$value->id))?>">Xóa</a>

            </div>
            <?php } ?>
            <input type="file" name="file_upload_slide[]" multiple>
        </div>
    </div>

    <section class="col-lg-9">
        <label>Danh mục</label>
        <select name="category_id">
            <?php
            foreach($listcategory as $key => $value){
                ?>
                <option value="<?php echo $value->id;?>"<?php if($itemproduct->category_id==$value->id)echo "selected=''";?> > <?php echo $value->category_name;?></option>
            <?php
            }
            ?>
        </select>
    </section>

    <section class="col-lg-9">
        <label>Loại - hãng sản xuất</label>
        <select name="type_id">
            <?php
            foreach($listtype as $key => $value){
                ?>
                <option value="<?php echo $value->id;?>"<?php if($itemproduct->type_id==$value->id)echo "selected=''";?> > <?php echo $value->type_name;?></option>
            <?php
            }
            ?>
        </select>
    </section>
    <section class="clear"></section>
    <div class="form-group">
        <div class="form-group">
            <label>Status</label>
            <div class="radio">
                <label>
                    <input type="radio" name="status" id="optionsRadios" value="1" checked> hiện
            </div>
            <div class="radio">
                <label>
                    <input type="radio" name="status" id="optionsRadios2" value="0">ẩn
                </label>
            </div>
        </div>
    </div>
    <div class="form-group">
        <input type="submit" name="submit" value="submit">
    </div>
</form>
<sectionn class="clear"></sectionn>
